function mythunk(store) {
  let { dispatch, getState } = store;
  return function (next) {
    return function newDispatch(action) {
      if (typeof action == 'function') {
        return action(next, getState)
      }
      return next(action)
    }
  }
}

export default mythunk